<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class Report extends Model
{
    use SoftDeletes;
    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [
        'user_id', 'rules', 'remarks', 'status','reportable_id','reportable_type'
    ];
    
    // 举报人
    public function user()
    {
        return $this->belongsTo(\App\User::class);
    }
    
    /**
     * Get all of the owning commentable models.
     */
    public function reportable()
    {
        return $this->morphTo();
    }
}
